<?
/**
 * Default input.
 *
 * @params	form	name of form
 * @params	name	name of field
 * @params	value	value of field
 * @params	options	options of field
 * @params	onchange	code to run ononchange
 * @params	preview	true to show preview image
 */
 
$size = $params["size"]?$params["size"]:24;

$oc = " onchange='if(document.all) {i=document.getElementById(\"{$params["name"]}-preview\"); i.src=value; i.height=64; }' ";

echo "<input type=file size=$size name=\"{$params["name"]}\" ".
	"value=\"".htmlspecialchars($params["value"])."\"$oc>";

global $imagesurl,$topurl;

if ($params["value"]) {
	$src = "$topurl/shots/{$params["value"]}";
	echo "<br><img src=\"$src\" id=\"{$params["name"]}-preview\" height=64>";
	} else {
	$src = "$imagesurl/misc/blank.gif";
	echo "<br><img src=\"$src\" id=\"{$params["name"]}-preview\" height=1>";
	}
	
?>